﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeBehind="scheduler_Param_frame.aspx.cs" Inherits="Ccit.OA.Scheduler.scheduler_Param_frame" %>
<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>日程管理-查询条件设置</title> 
     <script language="javascript" type="text/javascript" src="../script/jquery.js"></script>
    <script language="javascript" type="text/javascript" src="../script/StringClass_Ext.js"></script>
    <script language="javascript" type="text/javascript" src="../script/jsonlib.js"></script>
    <script language="javascript" src="../script/jwindow.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jcontrol.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jbase64.js" type="text/javascript"></script>
    <script type="text/javascript">
        function doSelectedIndex()
             {
                var DateType =  document.getElementById("ddlDateType").value;
                 if(DateType=="0")
                    {
                        document.getElementById("ddlDateDetail").disabled ="disabled";
                        document.getElementById("ddlDateDetail").value="0";
                    }
                    else
                    {
                         document.getElementById("ddlDateDetail").disabled ="";
                    }
            }
       function doEdit()
       {    
            var vTypeID = document.getElementById("_hidType").value;
            var vflag = document.getElementById("_hidFlag").value;
            var TabId =  document.getElementById("_hidTabId").value;       //时间
            var userId = getDeptUserId();                                       //用户id
            var typeId = getCellSelPlates();                                    //类型编号
            var DateType =  document.getElementById("ddlDateType").value;       //时间
            var DateDetail =  document.getElementById("ddlDateDetail").value;   //时间明细
            var title = document.getElementById("tbTitle").value;               //标题
            var vSite = document.getElementById("tbSite").value;                //地点
            var vMark = document.getElementById("ddlMark").value;               //标志
            var vSaic = userId +"_"+DateType+"_"+DateDetail+"_"+title+"_"+vSite+"_"+vMark+"_"+typeId;
            if(vflag=="")
            { 
                var oPageParam="Query="+vSaic+"&TABID="+TabId;
                var oEncodeParam=base64encode(oPageParam); 
                var strUrl ="scheduler_Search_list.aspx?"+oEncodeParam;
                window.location.href =strUrl; 
            }
            else{
                opener.document.getElementById("_hidQuery").value=vSaic;
                opener.document.getElementById("_hidTabId").value=TabId;
                opener.DoBack();
                 window.close();
             }
       }
        function getDeptUserId()
        {
               var userIds = window.frames[0].GetcheckUserIds();
                var userArr = userIds.split(",");
                var oStrResult="";
                for(var i=0;i<userArr.length;i++)
                {
                    var oUser=userArr[i];
                    var ostr=oUser.split("_");
                    if(ostr[2]!="dept"||ostr[1]!="1")
                        oStrResult+=(oStrResult=="") ? ostr[0] : ","+ostr[0];
                }
                return oStrResult;
        }
        function getCellSelPlates() {
            var oOptions = document.getElementById("lstType").options;
            var iLen = oOptions.length;
            var oOption;            
            var flowid=""; 
            for(var i = 0; i < iLen; i ++) { 
                oOption = oOptions[i];
                if(oOption.selected == true)
                {
                    if(i==0)
                        flowid +=oOption.value; 
                    else                
                        flowid +="," + oOption.value; 
                }
            } 
           return  flowid;
        }
    </script>
</head>
<body>
    <ccit:ActionForm id="form1" runat="server">
    <input  type="hidden" id="_hidType" runat="server" />
    <input  type="hidden" id="_hidTabId" runat="server" />
    <input  type="hidden" id="_hidFlag" runat="server" />
    <table cellpadding="0" cellspacing="0" width="100%" height="99%" border="0" align="center">
            <tr>
                <td colspan="2">
                    <table class="tbToolbar" cellpadding="0" cellspacing="0" width="100%" align="center" id="TablePrint">
                        <tr>
                            <td align="left">
                                <div class="tbSeparator"></div>
                            </td>
                            <td width="100%" class="titlebar">  
                                 日程管理-查询条件设置
                            </td>                
                            <td align="right">
                                <nobr> 
                                </nobr>
                            </td> 
                        </tr>
                </table>
                </td>
            </tr> 
            <tr>
            <td></td>
            </tr>   
            <tr>
                <td style="width:28%;  height:98%;" align="center" valign="top">
                    <table cellpadding="0" cellspacing="0" width="98%" align="right" border="0" 
                        style="height: 98%" >
                          <tr>
                             <td align="center" >
                                   <table cellpadding="0" cellspacing="0" width="100%" align="right">
                                        <tr>
                                            <td width="1"><img src="../images/pagetab_h_left.gif" id="ast_left_user" border="0" /></td>   
                                            <td width="80" align="center" background="../images/pagetab_bg_high.gif" id="user" class="PageTabRangeSelect">
                                                <nobr>&nbsp;<a id="auser" class="linktext" href="javascript:doChangeTab('user')"><strong>组织机构</strong>&nbsp;</a></nobr>
                                            </td>
                                            <td width="1"><img src="../images/pagetab_h_right.gif"  id="ast_right_user" /></td> 
 
                                            <td background='./images/pagetab_bg.gif'>&nbsp;</td>        
                                       </tr>      
                                   </table>
                                </td>
                          </tr> 
                         <tr>		
                            <td align="right">
                                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CECECE"	height="3">	
                                    <tr>
                                        <td width="100%">
                                            <div id="toolbar_text"></div>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr> 
                        <tr>
                            <td valign="top"  height="100%" align="center" style="border-right:#CDCECF 1px solid;border-left:#CDCECF 1px solid;border-bottom:#CDCECF 1px solid;border-top:#D9D9DA 0px solid;height:100%">                    
                                <iframe id="iFrmView"  src="scheduler_Search_set.aspx" name="iFrmView" height="99%" width="100%" scrolling="auto" frameborder="0" >
                                </iframe>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="100%" valign="top" align="center"> 
                         <table cellpadding="0" class="tableborder" cellspacing="0" width="98%" align="center"  runat="server">
                                    <tr>
                                        <td class="pformleft" width="15%"  align="right">时间</td>
                                        <td class="pformright">
                                            <asp:DropDownList ID="ddlDateType" runat="server" Width="98%" onchange="doSelectedIndex()">
                                                <asp:ListItem Value="0" Text="无" Selected/>
                                                <asp:ListItem Value="1" Text="开始时间"/>
                                                <asp:ListItem Value="2" Text="结束时间"/>
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="pformleft">&nbsp;</td>
                                        <td  class="pformright">
                                            <asp:DropDownList ID="ddlDateDetail" runat="server" Width="98%">
                                                <asp:ListItem Value="0" Text="任意时间" Selected/>
                                                <asp:ListItem Value="1" Text="昨天"/>
                                                <asp:ListItem Value="2" Text="今天"/>
                                                <asp:ListItem Value="3" Text="明天"/>
                                                <asp:ListItem Value="4" Text="最近7天"/>
                                                <asp:ListItem Value="5" Text="后7天"/>
                                                <asp:ListItem Value="6" Text="上周"/>
                                                <asp:ListItem Value="7" Text="本周"/>
                                                <asp:ListItem Value="8" Text="下周"/>
                                                <asp:ListItem Value="9" Text="上个月"/>
                                                <asp:ListItem Value="10" Text="本月"/>
                                                <asp:ListItem Value="11" Text="下个月"/>
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td  align="right" class="pformleft">标题</td>
                                        <td class="pformright" align="left"><asp:TextBox ID="tbTitle" runat="server" CssClass="input" Width="98%"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="pformleft" align="right">地点</td>
                                        <td class="pformright" align="left"><asp:TextBox ID="tbSite" runat="server" CssClass="input"  Width="98%" ></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="pformleft" align="right">完成标志</td>
                                        <td class="pformright">
                                            <asp:DropDownList ID="ddlMark" runat="server" Width="98%">
                                                <asp:ListItem Value="2" Text="全部"/>
                                                <asp:ListItem Value="0" Text="未完成"/>
                                                <asp:ListItem Value="1" Text="已完成"/>
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="pformleft" align="right">类别</td>
                                        <td class="pformright">
                                            <asp:ListBox ID="lstType" SelectionMode="Multiple" Width="98%" Rows="5" runat="server"></asp:ListBox>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>  
                    <tr>
                     <td class="pformstrip" colspan="2" align="center" valign="top">
                        <input type="button" id="btnSearch" runat="server" class="button" value="执行查询" onclick="doEdit()"  /> 
                        &nbsp;
                        <input type="button" id="btnClose" runat="server" class="button" value="关闭" onclick="window.close();" />
                     </td>
                   </tr>    
    </table>
    </ccit:ActionForm>
</body>
</html>
